// 创建schema(约束条件)
// 创建模型对象 model 创建students集合
const mongoose = require("mongoose")
const Schema = mongoose.Schema;
const studentSchema = new Schema({
    stu_id: {
        type: String,
        unique: true,
        required: true
    },
    stu_name: {
        type: String,
        unique: false,
        required: true
    },
    stu_sex: {
        type: String,
        unique: false,
        required: true,
    },
    stu_date: {
        type: Date,
        default: Date.now
    },
    stu_jg: {
        type: String,
    },
    stu_gbf: {
        type: String,
        default: '蔡徐坤'
    },
    stu_hobby: Schema.Types.Mixed,
    stu_head_img: {
        type: String
    }
});

const Students = mongoose.model("students", studentSchema)
module.exports = Students;